//
// Created by 高森森 on 2022/9/28.
//

#ifndef LEETCODE_SOLUTION_11_H
#define LEETCODE_SOLUTION_11_H
#include<bits/stdc++.h>
using namespace std;

class solution_11 {
public:
    bool checkPossibility(vector<int>& nums) {
        int count=0;
        for(int i=0;i<nums.size()-1;i++){
        if(nums[i]>nums[i+1]){
            count++;
        }
        if(count>1){
            return false;
        }
        if((i>0&&nums[i-1]>nums[i+1])&&(i+1<nums.size()-1&&nums[i]>nums[i+2])){
            return false;
        }
        }
        return true;
    }
};


#endif //LEETCODE_SOLUTION_11_H
